package com.design.singleton;

public class SingletonLazyObject {
    private static SingletonLazyObject object;

    private SingletonLazyObject (){};

    public static SingletonLazyObject getSingletonLazy(){
        // 懒汉双重校验模式，保证线程安全
        if (object == null){
            synchronized (SingletonLazyObject.class){
                if(object == null){
                    return new SingletonLazyObject();
                }
            }
        }

        return object;
    }
}
